<?php
/**
 * @package DK_Eshop
 * @version 1.0
 */
 
/*

Plugin Name: DK Eshop
Plugin URI: http://micheal.dazake.com
Description: This is a Plugin Let User add products . The plugin Integrated with WP-Eshop and WP-Emember . Befor activate this plugin ,you nedd to install that two plugin first.
Author: Micheal Of Dazake
Version: 1.0
Author URI: http://micheal.dazake.com
*/
// Include other functionality
define('DK_STATS_MENU_PERMISSION', "read");
define('DK_PLUGIN_DIR', dirname(__FILE__));
define('DK_PLUGIN_FUNCTION_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR .'functions' . DIRECTORY_SEPARATOR);


require_once dirname(__FILE__) . '/function.php';
//add script
add_action( 'admin_init', 'mk_my_plugin_admin_init' );
function mk_my_plugin_admin_init() {
    /* Register our script. */
    wp_register_script( 'mk-my-plugin-upload-script', plugins_url('/script.js', __FILE__) );
}

//add menu
add_action('admin_menu', 'register_custom_menu_page');	 
function register_custom_menu_page() {
	add_menu_page(__("Products Catalogue", 'wp_mk_eshop'), __("Products Catalogue", 'wp_eStore'), DK_STATS_MENU_PERMISSION,__FILE__,"wp_dk_estore_product_management_menu");
	
	add_submenu_page(__FILE__, __("Manage Products", 'wp_eStore'), __("Manage Products", 'wp_eStore'), DK_STATS_MENU_PERMISSION, __FILE__, "wp_dk_estore_product_management_menu");
	
	$mk_add_page = add_submenu_page(__FILE__, __("Add/Edit Products", 'wp_eStore'), __("Add/Edit Products", 'wp_eStore'), DK_STATS_MENU_PERMISSION, 'dk_eStore_addedit', "wp_dk_estore_add_product_menu");
	
	add_submenu_page(__FILE__, __("Manage Customers", 'wp_eStore'), __("Manage Customers", 'wp_eStore'), DK_STATS_MENU_PERMISSION, 'dk_estore_customer_management', "wp_dk_estore_customer_management_menu");
	// add_submenu_page(__FILE__, __("Categories", 'wp_eStore'), __("Categories", 'wp_eStore'), DK_STATS_MENU_PERMISSION, 'dk_eStore_categories', "wp_dk_eStore_manage_categories_menu");
	add_submenu_page(__FILE__, __("Add/Edit Customers", 'wp_eStore'), __("Add/Edit Customers", 'wp_eStore'), DK_STATS_MENU_PERMISSION, 'dk_eStore_customer_addedit', "wp_dk_estore_add_customer_menu");
	
	
	add_action('admin_print_styles-' . $mk_add_page, 'mk_my_plugin_admin_script');
}


function mk_my_plugin_admin_script() {
    wp_enqueue_script( 'jquery' );
	wp_enqueue_script('media-upload');
	wp_enqueue_script('thickbox');
	wp_enqueue_script('mk-my-plugin-upload-script');	    	
	wp_enqueue_style('thickbox');
}